use crate::i_result::IResult;

pub fn reqwest_get(url: &str) -> IResult<String> {
    let res = reqwest::blocking::get(url)?.text()?;
    Ok(res)
}

pub fn reqwest_post(url: &str, body_str: String) -> IResult<String>{
    let client = reqwest::blocking::Client::new();
    let res: String = client.post(url)
        .body(body_str)
        .send()?.text()?;
    Ok(res)
}
